import time

from faker import Faker

fake = Faker(locale='zh_CN')


def rdm_phone_number():
    return fake.phone_number()

def cur_timestamp(level='ms'):#到毫秒级的时间戳
    if level=='ms':
        # 到毫秒级的时间戳
        return int(time.time() * 1000)
    elif level=='s':
        # 到秒级的时间戳
        return int(time.time())
    else:
        raise Exception(f'{level}不支持')

def gen_timestamp(start_date='+0d',end_date='+1d'):
    date_time = fake.date_time_between(start_date,end_date)
    print(date_time)
    return int(time.mktime(date_time.timetuple()))


def cur_date():# 2022-09-29
    return fake.date_between_dates()

def cur_date_time():# 2022-09-29 10:07:33
    return fake.date_time_between_dates()

def rdm_date(pattern='%Y-%m-%d'):
    return fake.date(pattern=pattern)

def rdm_date_time():
    return fake.date_time()

def sssee(a,b):
    return a+b
